package org.example.controller;

import org.example.entity.Answer;
import org.example.service.AnswerService;
import org.example.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName AnswerController
 * @Description TODO
 * @Author yuezhijie
 * @Date 2025年08月16日 10:28
 * @Version 1.0
 */
@RestController
@RequestMapping("answer")
public class AnswerController {
    @Autowired
    private AnswerService answerService;
@GetMapping("{id}")
    public R selectAll(@PathVariable("id") int id){
        List<Answer> answers = answerService.selectAll(id);
        return R.ok(answers);
    }
}
